package com.nmsl.statistic.domain;

import lombok.Data;
import org.apache.poi.ss.formula.functions.T;

import java.util.List;

@Data
public class RedisPage<T>  {
//    数据总量
    private Long total;
//    页面大小
    private Long size;
//    当前页
    private Long curentPage;
//    key
    private String key;
    private List<T> data;
    public static <T> RedisPage<T> build(List<T> data,Long total,Long size,Long curentPage,String key){
        RedisPage<T> page = new RedisPage<>();
        page.setData( data);
        if (curentPage<=0l || curentPage == null){
            curentPage = 0l;
        }
        page.setCurentPage(curentPage);
        page.setKey(key);
        page.setTotal(total);
        page.setSize(size);
        return page;
    }
}
